Hibernation (computing)

Hibernation in computing is powering down a computer while retaining its state.

Upon hibernation, the computer saves the contents of its random access memory (RAM) to a hard disk or other non-volatile storage. Upon resumption, the computer is exactly as it was upon entering hibernation.

When used to save power, hibernation is similar to sleep mode and saves more power at the cost of slower resumption.

Contents

Uses of hibernation

Hibernation saves electrical power. After hibernating, the hardware is completely powered down (just like for a regular shutdown). Therefore a hibernated machine uses no more electrical power than one which is switched off. Meanwhile, hibernation is a means of avoiding the burden of saving unsaved data before shutting down and restoring all running programs after powering back on.

Hibernation is used in laptops, which have limited battery power available. It can be set to happen automatically on a low battery alarm. Most desktops also support hibernation, mainly as a general energy saving measure.

Problems with hibernation

In some cases entering into hibernation can cause incorrect operation on restarting, due to problems with the hibernation software, or with devices or software which is not fully compliant. Hibernation will also usually cause connections to peripheral devices to terminate; this may cause problems for peripherals that were in use when hibernation started.

Some organizations (mainly large enterprises) mandate automatic hibernation (e.g. as a network policy) if a computer system has been idle for a certain amount of time, mainly as an energy saving measure. This saves some energy at the cost of some lost productivity waiting for the state to be restored.

Comparison to sleep mode

Many systems also support a low-power sleep mode or stand by mode in which the processing functions of the machine are powered down, using a little power to preserve the contents of RAM and support waking up; wakeup is almost instantaneous.

The advantage of sleep mode is that resuming is much quicker than for hibernation. A hibernated system must start up, then read back data to RAM on resuming, which typically takes on the order of tens of seconds, while a system in sleep mode only needs to power up CPU and display, which is almost instantaneous. On the other hand, a system in sleep mode still consumes some power, while a hibernated system does not require any power at all: power can be completely disconnected. A sleeping computer is a case of a device consuming standby power, covered by regulations in many countries limiting such power under the One Watt Initiative to one watt from 2010. Since these facilities were introduced, most systems have come to offer both sleep mode and hibernation.

Hybrid sleep

Sleep mode and hibernation can be combined: The contents of RAM are copied to non-volatile storage and the computer enters sleep mode. This approach combines the benefits of sleep mode and hibernation: The machine can resume instantaneously, and its state, including open and unsaved files, will survive a power outage.[1][2]

Operating system support

Early implementations of hibernation used the BIOS, but modern operating systems usually handle hibernation. Hibernation is defined as sleeping mode S4 in the ACPI specification.[3]

Microsoft Windows

On Windows computers, hibernation is available only if all hardware is ACPI and Plug-and-play compliant, and additionally all drivers are PnP-compatible. The Microsoft Help and Support website also describes a command line instruction to invoke hibernation, in article #555569[4]; such command line instructions can be added to many keyboard instruction sets to hibernate computers at the touch of a (programmable) button.

Windows 95 supported hibernation through hardware manufacturer-supplied drivers and only if compatible hardware and BIOS were present. Since Windows 95 supported only Advanced Power Management (APM), hibernation was then known as Suspend-to-Disk. Windows 98 and later support ACPI. However, hibernation often caused problems since most hardware was not fully ACPI 1.0 compliant or did not have WDM drivers. There were also issues with the FAT32 file system.[5]

Windows 2000 was the first Windows release to support hibernation at the operating system level (OS-controlled ACPI S4 sleep state) without special drivers from the hardware manufacturer. A file, "hiberfil.sys" is used to store the contents of RAM when the computer hibernates, and is always the same size as the total RAM. A hidden system file resides in the root of the system partition, usually "C:\hiberfil.sys". This file is a full snapshot of the physical RAM memory compressed with an LZXPRESS algorithm, and contains further information including processor state. Although this file is undocumented, a security researcher, Matthieu Suiche, documented it[6] during Black Hat Briefings 2008 and has also provided a computer forensics framework to manage and convert this file into a readable memory dump.[7]

Windows Me, the last release in the Windows 9x family, also supports OS controlled hibernation and requires half the amount of disk space of the computer's RAM.[8] [9]

Windows XP further improved support for the hibernate function.[10] Hibernation and resume-from-hibernate are much faster as memory pages are compressed using an improved algorithm, compression is overlapped with disk writes, unused memory pages are freed and DMA transfers are used during I/O. [11]

Windows Vista introduced a Hybrid Sleep feature for desktop computers, which when enabled, combines hibernation with standby (sleep) by saving the contents of volatile memory to hard disk before entering sleep mode. If power to memory is lost, it will use the hard disk to wake up. Users have the option of hibernating directly without enabling hybrid sleep if they wish.

Windows 7 introduced the ability to compress the hibernation file using powercfg.exe. It can be set from anywhere between 50% to 100% of the total physical memory using the -size switch in powercfg.exe, so the hibernation file is compressed and uses less disk space. The default size is 75% [12]

Windows 8's resume-from-hibernation algorithm is multi-core optimized. Windows 8 also introduces a Hybrid Boot feature. When users select the Shut Down option, it hibernates the computer, but closes all programs and logs out the user session before hibernating. [13] According to Microsoft, a regular hibernation includes more data in memory pages which takes longer to be written to disk. In comparison, when the user session is closed, the hibernation data is much smaller and therefore takes lesser time to write to disk and resume. Users have the option of performing a traditional shutdown by holding down the Shift key while clicking Shut Down.

Hibernate is often under-used in business environments as it is difficult to enable post-deployment without resorting to third-party PC power management software[14] This omission by Microsoft has been criticized as having led to a huge waste in energy.[15]

There is a significant market in third-party PC power management software offering features beyond those present in the Windows operating system.[16][17][18] available. Most products offer Active Directory integration and per-user/per-machine settings with the more advanced offering multiple power plans, scheduled power plans, anti-insomnia features and enterprise power usage reporting. Notable vendors include 1E NightWatchman.[19][20], Data Synergy PowerMAN (Software)[21] and Verdiem SURVEYOR[22]

Windows hibernation mode can be disabled as well as the side benefit of deleting the hiberfil.sys file using a simple command.[23]

Mac OS X

On Macs, a feature known as Safe Sleep saves the contents of volatile memory to the system hard disk each time the Mac enters Sleep mode. The Mac can instantaneously wake from sleep mode if power to the RAM has not been lost. However, if the power supply was interrupted, such as when removing batteries without an AC power connection, the Mac would wake from Safe Sleep instead, restoring memory contents from the hard drive.[24] Because Safe Sleep's hibernation process occurs during regular Sleep, the Apple menu does not have a "hibernate" option.

Safe Sleep capability is found only in new Mac models starting with the October 2005 revision of the PowerBook G4 (Double-Layer SD). Mac OS X v10.4 or higher is also required.

Shortly after Apple started supporting Safe Sleep, Mac enthusiasts released a hack to enable this feature for much older Mac computers running Mac OS X v10.4.[25] Classical Mac OS once also supported hibernate, but this feature was dropped by Apple.[26]

Linux

In the Linux kernel, Hibernate or suspend-to-disk, suspend-to-ram, suspend-to-file is implemented by swsusp which is built into the 2.6 series. An alternative implementation is TuxOnIce which is available as patches for the 2.4 and 2.6 kernels. Other alternative implementations also exist, namely, uswsusp (user-space suspend). TuxOnIce provides advantages such as support for SMP, 4GB high mem and preemption.

See also

References

  1. ^ "Turn off a computer: frequently asked questions". Windows Vista Online Help. Microsoft Corporation. http://windows.microsoft.com/en-US/windows-vista/Turn-off-a-computer-frequently-asked-questions. Retrieved 15 October 2011. 
  2. ^ "Sleep and hibernation: frequently asked questions". Windows 7 Online Help. Microsoft Corporation. http://windows.microsoft.com/en-us/windows7/Sleep-and-hibernation-frequently-asked-questions. Retrieved 15 October 2011. 
  3. ^ ACPI Specification Rev 3.0b
  4. ^ Microsoft Help and Support - How To Put the System into hibernation or Standby from Run menu
  5. ^ BIOS and Hibernate Issues for FAT32 File System
  6. ^ BlackHat USA 2008 - Windows hibernation file for fun and profit
  7. ^ SandMan Computer Forensics Framework
  8. ^ "Interview with Nicolas Coudière, Chief Product Manager: Microsoft Windows Millennium Edition (Me)". Activewin.com. http://www.activewin.com/interviews/microsoft/7.shtml. Retrieved 2010-08-26. 
  9. ^ "Windows Power Management". Microsoft.com. 2001-12-04. http://www.microsoft.com/whdc/archive/winpowmgmt.mspx#EUE. Retrieved 2010-08-26. 
  10. ^ Windows Power Management: Instant PC availability and energy savings
  11. ^ Kernel Enhancements for Windows XP
  12. ^ Reducing the Disk Footprint for Windows 7 Hibernation
  13. ^ Delivering fast boot times in Windows 8
  14. ^ Enable hibernate using group policy
  15. ^ EcoGeek - How Windows XP Wasted $25 Billion of Energy
  16. ^ "Power Management Software for Windows Workstations". http://www.windowsitpro.com/article/buyers-guide/Power-Management-Software-for-Windows-Workstations-Buyers-Guide.aspx. 
  17. ^ "Energy Star Commercial Packages List". http://www.energystar.gov/index.cfm?c=power_mgt.pr_power_mgt_comm_packages. 
  18. ^ The Headmasters' and Headmistresses' Conference. "HMC: A Practical Guide to Sustainable Building for Schools". http://www.hmcsustainability.org.uk/energy.html. 
  19. ^ "PC Power Management Solutions". http://itmanagersinbox.com/1399/pc-power-management-solutions. 
  20. ^ "Why use software NightWatchman to turn your PCs off?". http://features.techworld.com/green-it/3546/why-use-software-nightwatchman-to-turn-your-pcs-off/. 
  21. ^ "University of Oxford Low Carbon Project: Energy and the networked computing environment". http://projects.oucs.ox.ac.uk/lowcarbonict/conferences/conf-2.htm#providers. 
  22. ^ "1E upgrades NightWatchman, seeks to bring powermanagement to SMEs: Competitive landscape". http://www.1e.com/Downloads/Articles/Published/451%20-%201E%20-%20Market%20Development-020309.pdf. 
  23. ^ How to disable and re-enable hibernation on a computer that is running Windows; Microsoft; August 12, 2010.
  24. ^ Apple Support: Progress bar appears after waking from sleep
  25. ^ http://web.archive.org/web/20080105000720/http://andrewescobar.com/archive/2005/11/11/how-to-safe-sleep-your-mac/
  26. ^ http://docs.info.apple.com/article.html?artnum=59016